<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="result">

    </div>
    <script>
        // 1. 定义一个fn函数，设置形参
        function fn(data){
             // 2. 将参数放入 div中
            console.log(data); //{msg: '获取成功', code: 200}

            document.querySelector('#result').innerHTML = data.msg;
        }

        // 3. 导入带有fn函数调用的js文件
    </script>
    <script src="./14-demo.js"></script>
    <!-- <script src="http://localhost/jsonpServer?cb=fn"></script> -->
</body>

</html>